using System;
using System.Text;
using System.Net;
using MIS.EN.Exchange.Entities;

namespace MIS.EN.Exchange
{
    internal class TaskFolderWorker : FolderWorker<Task>
    {
        public TaskFolderWorker(NetworkCredential credentials, bool useFormsBasedAuthentication, bool useIsaServer2006)
            : base(credentials, useFormsBasedAuthentication, useIsaServer2006)
        {
        }

        protected override void BuildContentClassNode(StringBuilder xmlBuilder)
        {
            xmlBuilder.Append("urn:content-classes:task");
        }

        protected override void BuildMessageClass(StringBuilder xmlBuilder)
        {
            xmlBuilder.Append("IPM.Task");
        }

        protected override string FolderName
        {
            get { return "Tasks"; }
        }

        protected override Type ItemType
        {
            get { return typeof(Task); }
        }

        protected override void BuildNamespaces(bool useWebDavReplication)
        {
            base.BuildNamespaces(useWebDavReplication);
            base.WebDavDocumentNamespaces.Add("b", "urn:uuid:c2f41010-65b3-11d1-a29f-00aa00c14882/");
            base.WebDavDocumentNamespaces.Add("con", "urn:schemas:contacts:");
            base.WebDavDocumentNamespaces.Add("header", "urn:schemas:mailheader:");
            base.WebDavDocumentNamespaces.Add("mail", "urn:schemas:httpmail:");
            base.WebDavDocumentNamespaces.Add("mapiid", "http://schemas.microsoft.com/mapi/id/{00062003-0000-0000-C000-000000000046}/");
        }

        protected override string PropertyMappingsFileName
        {
            get { return "MIS.EN.Exchange.PropertyMappings.TaskPropertyMappings.xml"; }
        }

        protected override bool UsesHexadecimalXmlNames
        {
            get { return true; }
        }
    }
}
